package com.bl.student.dao.repository;

import com.bl.student.common.enums.GoodsType;
import com.bl.student.common.enums.OnlineStatus;
import com.bl.student.dao.model.GoodsEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.Repository;

import java.util.List;

/**
 * Created by liangweikang on 18/1/29.
 */
public interface GoodsRepository extends PagingAndSortingRepository<GoodsEntity, String> {

//    Page<GoodsEntity> findByStatusAndTypeEqualsOrderByWeightDesc(OnlineStatus status, GoodsType goodsType,Pageable pageable);

//    List<GoodsEntity> findByStatusAndTypeOrderByMonthsAsc(OnlineStatus status, GoodsType goodsType);

    //    返回产品列表
    Page<GoodsEntity> findByOrderByWeightDesc(Pageable pageable);
    //    返回搜索结果
    List<GoodsEntity> findByTitleLike(String title);



}
